<?php

namespace App\Services\Component;

use App\BO\Product\ProductBOFactory;
use App\Entity\ComponentProductEntity;
use App\Entity\ProductEntity;

class Product implements Component
{
    /**
     * @var ComponentProductEntity
     */
    public $productCp;

    /**
     * @var ProductEntity
     */
    public $cityProductEn;

    /**
     * Product constructor.
     * @param ComponentProductEntity $productCp
     * @param int $cityId
     * @throws
     */
    public function __construct(ComponentProductEntity $productCp, int $cityId = 0)
    {
        $this->productCp = $productCp;
        if ($cityId) {
            $pf = ProductBOFactory::getByProductIdAndCityId($this->productCp->getProductId(), $cityId);
            $this->cityProductEn = $pf->getCityProductInfo();
        } else {
            $this->cityProductEn = ProductEntity::find($this->productCp->getProductId());
        }
    }

    public function getImg(): string
    {
        // TODO: Implement getImg() method.
    }

    public function getTitle(): string
    {
        // TODO: Implement getTitle() method.
    }

    public function getLink(): string
    {
        // TODO: Implement getLink() method.
    }

    public function getSort(): int
    {
        // TODO: Implement getSort() method.
    }

}
